﻿@{
    ViewBag.Title = "GOC Report";
}
@section Menu
{
    @Html.Partial("~/Views/Menu/Gocs.cshtml")
}
<script type="text/javascript">
    $(function () {
        $("#downloadFile").click(function (e) {
            e.preventDefault();

            window.location = '@Url.Action("GenerateGocAttributesReport", "Goc")?month=' + $('#reportMonth').val() + '&year=' + $('#reportYear').val();
        });
    });
</script>
<h2>
    GOC Report</h2>
    <br />
<h5>
    Select the date to filter the report</h5>
    
Month:
<select id="reportMonth">
    <option value="@DateTime.Today.AddMonths(-1).Month">@DateTime.Today.AddMonths(-1).ToString("MMMM")</option>
    <option selected="selected" value="@DateTime.Today.Month">@DateTime.Today.ToString("MMMM")</option>
    <option value="@DateTime.Today.AddMonths(1).Month">@DateTime.Today.AddMonths(1).ToString("MMMM")</option>
</select>
Year:
<select id="reportYear">
    @if (DateTime.Today.Month == 1)
    {
        <option value="@DateTime.Today.AddYears(-1).Year">@DateTime.Today.AddYears(-1).Year</option>
    }
    <option selected="selected" value="@DateTime.Today.Year">@DateTime.Today.Year</option>
    @if (DateTime.Today.Month == 12)
    {
        <option value="@DateTime.Today.AddYears(1).Year">@DateTime.Today.AddYears(1).Year</option>
    }
</select>
<br /><br />
<button type="button" class="btn" value="DownloadFile" id="downloadFile">Download Report</button>